#pragma once
#include <vector>
#include "Subject.h"

using namespace std;
class Arm;

class AlarmZone : public Subject
{
private:
	AlarmZone(int x1,int y1,int x2,int y2):
	   x1(x1),y1(y1),x2(x2),y2(y2) {}
	static AlarmZone *AZ;
public:
	vector<Arm*> ArmsInZone;
	int x1,x2;
	int y1,y2;

	static AlarmZone *AlarmZoneGet(int x1,int y1,int x2,int y2)
	{
		if (AZ==NULL)
			AZ =  new AlarmZone(x1,y1,x2,y2);
		return AZ;
	}
	static AlarmZone *AlarmZoneGet()
	{
		return AZ;
	}

	void Add(Arm * a);
	void Remove(Arm * a);

	int GetArmsInZone()
	{
		return (int)ArmsInZone.size();
	}
};

AlarmZone *Alarm();